package org.iqiyi.controller;


import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached;
import io.seata.spring.annotation.GlobalTransactional;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.iqiyi.feign.UserServiceFeign;
import org.iqiyi.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.iqiyi.controller.NewsController;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author huqi
 * @since 2021-04-17
 */
@Api(value = "咨询模块",tags = "咨询模块")
@RestController
@RequestMapping("/news")
public class NewsController {
    @Resource
    private UserServiceFeign userServiceFeign;
    @Autowired
    private NewsService newsService;

    @Cached(name = "news")
    @GetMapping("/getTest")
    public Object Object(){
        return newsService.list();
    }

    @Cached(name = "news1")
    @GetMapping("/getTest1")
    public Object Object1(){
        return newsService.list();
    }
}

